using System.ComponentModel.DataAnnotations.Schema;

namespace QuanLyThuPhiTaiLieu.Entity
{
    [Table("DanhMucBoSung")]
    public class DanhMucBoSung
    {
        public int Id { get; set; }

        [Column("SBQ")]
        public string Sbq { get; set; }

        [Column("KHLT")]
        public string Khlt { get; set; }

        [Column("KhaiThacId")]
        public int KhaiThacVaSuDungTaiLieu { get; set; }

        [Column("DanhMucId")]
        public int DanhMuc { get; set; }

        [Column("ThamKhaoId")]
        public int ThamKhao { get; set; }

        public string NoiDung { get; set; }

        public string LoaiTaiLieu { get; set; }
    }

    public class DanhMucBoSungInfo
    {
        public int Id { get; set; }

        public string LoaiTaiLieu { get; set; }

        public string NoiDung { get; set; }
                
        public string Sqb { get; set; }
                
        public string Khlt { get; set; }

        public string TenBaoCao { get; set; }
                
        public int? KhaiThac { get; set; }

        public int? ThamKhao { get; set; }

        private string maTaiLieu;
        public string MaTaiLieu 
        {
            get
            {
                return string.IsNullOrEmpty(MaKhaiThac) ? MaThamKhao : MaKhaiThac;
            }
            set 
            {
                maTaiLieu = value;
            }
        }

        private string tenLoaiTaiLieu;
        public string TenLoaiTaiLieu 
        {
            get
            {
                return string.IsNullOrEmpty(TenLoaiTaiLieuKhaiThac) ? TenLoaiTaiLieuThamKhao : TenLoaiTaiLieuKhaiThac;
            }
            set
            {
                tenLoaiTaiLieu = value;
            }
        }

        private string donViTinh;
        public string DonViTinh 
        {
            get
            {
                return string.IsNullOrEmpty(DonViTinhKhaiThac) ? DonViTinhThamKhao : DonViTinhKhaiThac;
            }
            set
            {
                donViTinh = value;
            }
        }

        public string MaKhaiThac { get; set; }

        public string TenLoaiTaiLieuKhaiThac { get; set; }

        public string DonViTinhKhaiThac { get; set; }

        public string DonViTinhThamKhao { get; set; }

        public string MaThamKhao { get; set; }

        public string TenLoaiTaiLieuThamKhao { get; set; }

    }
}
